<?php
use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\ArticleController;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\SeckillController;
use App\Http\Controllers\Admin\NodeController;
    Route::group(['prefix'=>'admin','namespace'=>'Admin'],function (){
        //登录页面
        Route::get('login',[LoginController::class,'index'])->name('admin.login');
        //登录处理
        Route::post('login',[LoginController::class,'login'])->name('admin.login');
        //退出登录
        Route::get('logout',[LoginController::class,'logout'])->name('admin.logout');
        //主页
        Route::group(['as'=>'admin.'],function(){
            //秒杀
            Route::get('seckill',[SeckillController::class,'index'])->name('seckill');
            //秒杀前
            Route::get('before',[SeckillController::class,'before'])->name('before');
            //秒杀倒计时
            Route::get('countdown',[SeckillController::class,'countdown'])->name('countdown');
            //秒杀后
            Route::get('behind',[SeckillController::class,'behind'])->name('behind');
            //主页
            Route::get('index',[IndexController::class,'index'])->name('index');
            //桌面
            Route::get('welcome',[IndexController::class,'welcome'])->name('welcome');
            //用户列表
            Route::get('user/index',[UserController::class,'index'])->name('user.index');
            //用户添加页面
            Route::get('user/create',[UserController::class,'create'])->name('user.create');
            //添加处理
            Route::post('user/store',[UserController::class,'store'])->name('user.store');
            //删除操作
            Route::get('user/destroy/{id}',[UserController::class,'destroy'])->name('user.destroy');
//            //修改页面
//            Route::get('user/edit',[UserController::class,'edit'])->name('user.edit');
//            //执行修改
//            Route::post('user/update',[UserController::class,'update'])->name('user.update');

            Route::get('node',[NodeController::class,"index"])->name('node.index');
            //文章管理
            Route::get('article/index',[ArticleController::class,'index'])->name('article');
            //文章删除
            Route::get('/article/destroy/{id}',[ArticleController::class,'destroy'])->name('article.destroy');
        });
    });

